/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

#pragma once

#include <map>

#include "Utility/Algebra/Matrix.h"

#include "DataStructure/Input/Element/ElementTypes.h"

#include "DBManager/IRepository/Base/IMainlyRepository.h"
#include "DBManager/IRepository/Base/SummaryDefine.h"

class IElementSummaryRepository : public virtual IMainlyRepository<SG::DBManager::SummaryInfo<SG::DataStructure::FEM::ElementTypes>>
{
  public:
    static constexpr std::size_t GetCurrentTypeNodeSize ()
    {
        return -1;
    }

    /**
     * @brief   : 单元类型
     */
    static constexpr SG::DataStructure::FEM::ElementTypes GetType ()
    {
        return SG::DataStructure::FEM::ElementTypes::ELETYPE_Unknown;
    }
    /**
     * @brief   : 返回所有已有数据的单元类型
     * @return  :
     * @author  : wxc
     * @date    : 2024.10.28
     */
    virtual std::vector<SG::DataStructure::FEM::ElementTypes> GetAllElementTypes () = 0;

    /**
     * @brief   : 根据单元id获取单元类型
     * @param   : Eid
     * @return  :
     * @author  : wxc
     * @date    : 2024.10.28
     */
    virtual SG::DataStructure::FEM::ElementTypes GetElementType (SG::DataStructure::Common::Id Eid) = 0;

    /**
     * @brief   : 类型为`type`的单元的数量
     * @param   : type
     * @return  :
     * @author  : wxc
     * @date    : 2024.10.28
     */
    virtual std::size_t GetElementSize (SG::DataStructure::FEM::ElementTypes type) = 0;

    /**
     * @brief   : 获取指定类型的所有单元ID
     * @param   : type 单元类型
     * @return  : 指定类型的所有单元ID列表
     * @author  : wuxingchuang
     * @date    : 2025.07.25
     */
    virtual std::vector<SG::DataStructure::Common::Id> GetElementIdsByType (SG::DataStructure::FEM::ElementTypes type) = 0;

    /**
     * @brief    获取属性ID与单元ID的映射关系
     *
     * @return
     * @author   wuxingchuang
     * @date     2025.08.01
     */
    virtual std::map<SG::DataStructure::Common::I64, SG::DBManager::TwoLayersData> GetP2EMap () = 0;

    /**
     * @brief    获取某单元类型的节点矩阵
     *
     * @param    type
     * @return
     * @author   wuxingchuang
     * @date     2025.07.31
     */
    virtual SG::Algebra::Matrix GetElementNodes (SG::DataStructure::FEM::ElementTypes type) = 0;
};
